\documentclass[E:/GsjzTle/main/main.tex]{subfiles}

\begin{document}

\begin{itemize}
\item
  复杂度大概 \(O(n^3)\)？
\end{itemize}

\begin{lstlisting}
using namespace std;
const int N = 2e2 + 10;
const ll mod = 1e9 + 7;
ll G[N][N];
int n , m;
ll pow_mod(ll x , ll n , ll mod)
{
	ll res = 1;
	while(n)
	{
		if(n & 1) res = res * x % mod;
		x = x * x % mod;
		n >>= 1;
	}
	return res;
}
void init(int n)
{
	rep(i , 0 , n) rep(j , 0 , n) G[i][j] = 0;
}
ll Gauss(int n)
{
	ll ans = 1;
	rep(i , 1 , n - 1)
	{
		rep(k , i + 1 , n - 1)
		{
			while(G[k][i])
			{
				ll d = G[i][i] / G[k][i];
				rep(j , i , n - 1) G[i][j] = (G[i][j] - d * G[k][j] % mod + mod) % mod;
				swap(G[i] , G[k]) , ans = -ans;
				
			}
		}
		ans = (ans * G[i][i] % mod + mod) % mod;
	}
	return ans;
}
signed main()
{
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	int T = 1;
	cin >> T;
	while(T --)
	{
		cin >> n >> m;
		init(n);
		rep(i , 1 , m)
		{
			int x , y ;
			cin >> x >> y ;
			G[x][x] ++ , G[y][y] ++;
			G[x][y] -- , G[y][x] --;
		}
		ll res = Gauss(n);
		cout << res << '\n';
	}
	return 0;
}
\end{lstlisting}

\end{document}
